Skip to main content

yContainer

ExampleBasicConfigExample1

Description

The yContainer is an element that can contain other elements as the name implies. It is used to structure the page and store elements.

Some uses for the yContainer are:

Properties

Through its various properties the yContainer can be configured to suit your needs. The display below provides you with an overview of all the yContainer properties.

Properties can be changed directly through three methods:

  • Inside the Toolbar, which is positioned in your workarea next to your component where you need it. It shows the most important properties, thus providing a fast and efficient way to configure your component in the most basic way.
  • It may also occur in the Toolbar Extension, which is a seamless extension accesible as a dropdown item of the Toolbar. It extends the functionality of the Toolbar by providing advanced pickers for most used properties.
  • Inside the Detail Panel, which is located in the righthand drawer. Every property of a component can be configured here.
METAread more
--y-container__component-id

The identifier of the component that is unique within a page.

--y-container__component-type

The type of the component. For this component it is -container.

--y-container__name

The custom name of the component. It serves for better identification of the component.

--y-container__version

The custom version of the Container-component. This can be used to ensure that all components work well together.

--y-container__core-theme

The CoreTheme, which will be apllied to the Container. For further information on themes visit the themes page.

--y-container__sub-theme

The subtheme subordinated to the previously specified CoreTheme, which will be apllied to the Container. For further information on themes visit the themes page.

--y-container__group-theme

The group theme is a further variation of the subtheme which is specified especially for variations of a component inside the subtheme. For further information on themes visit the Theme-Manager page.

DISPLAYread more
--y-container__display

This property specifies the display behavior of the component. This can be be set to:

  • none
  • block
  • flex
  • inline
--y-container__position

This property specifies the type of positioning method used for the component. This can be be set to:

  • static
  • relative
  • absolute
  • sticky
  • fixed
--y-container__visible

This property can toggle the visibility of the component. The two modes are completely hidden and fully shown.

SIZEread more
--y-container__min-width

The minimum value for the width of the component. This can be set in:

  • px
  • pt
  • em
  • vw
  • vh
  • %
--y-container__min-height

The minimum value for the height of the component. This can be set in:

  • px
  • pt
  • em
  • vw
  • vh
  • %
--y-container__width

The value for the width of the component. This can be set in:

  • px
  • pt
  • em
  • vw
  • vh
  • %
  • auto
--y-container__height

The value for the height of the component. This can be set in:

  • px
  • pt
  • em
  • vw
  • vh
  • %
  • auto
--y-container__max-width

The maximum value for the width of the component. This can be set in:

  • px
  • pt
  • em
  • vw
  • vh
  • %
  • none
--y-container__max-height

The maximum value for the height of the component. This can be set in:

  • px
  • pt
  • em
  • vw
  • vh
  • %
  • none
--y-container__flex

The flex property sets the length on flexible items. This sets the value in n-fold shares extrapolated to all other components with the flex display within the same container.

PLACEMENTread more
--y-container__margin-top

This property creates a space around the component, outside of the top border. This can be set in percent or pixels.

--y-container__margin-right

This property creates a space around the component, outside of the right border. This can be set in percent or pixels.

--y-container__margin-bottom

This property creates a space around the component, outside of the bottom border. This can be set in percent or pixels.

--y-container__margin-left

This property creates a space around the component, outside of the left border. This can be set in percent or pixels.

--y-container__padding-top

This property creates a space within the component, inside of the top border. This can be set in percent or pixels.

--y-container__padding-right

This property creates a space within the component, inside of the right border. This can be set in percent or pixels.

--y-container__padding-bottom

This property creates a space within the component, inside of the bottom border. This can be set in percent or pixels.

--y-container__padding-left

This property creates a space within the component, inside of the top border. This can be set in percent or pixels.

Usage

In this section you'll find a collection of application scenarios and examples that illustrate how to leverage the yContainer in ways that deviate from its standard behavior, as defined by yBase. This section aims to inspire and guide you through various possibilities, helping you to implement more complex or unique functionalities tailored to your specific needs. General properties that are universally applicable can be found in the yBase usage section.

Background

ContainerBackgroundExample1
stylebackgroundbg-imagehttps://www.vectorsoft.de/wp-content/uploads/2021/09/yeet-laptop-1024x633.png
stylebackgroundbg-sizecontain
stylebackgroundbg-repeatno-repeat
ContainerBackgroundExample2
stylebackgroundbg-imagehttps://www.vectorsoft.de/wp-content/uploads/2021/09/yeet-laptop-1024x633.png
stylebackgroundbg-sizecontain
stylebackgroundbg-repeatrepeat-x

Alignment

ContainerAlignmentExample1
ContainerAlignmentExample2
ContainerAlignmentExample3
stylealignmentflex-directioncolumn
stylealignmentjustify-contentcenter
stylealignmentalign-itemscenter
Info: Scroll behavior

If the content exceeds the parent element itself, a scrollbar appear. When needed, this scrollbar can be removed while keeping scrollability, when toggling show-scrollbar.

Theming

How to:

You can use the yContainer to theme submodules inside your page.

  1. Navigate to "Events" inside the Detail Panel and modify "EvtInit".
  2. Set SubTheme based on a selection from yToggle.

Code example:

In this example the user can adjust the current theme by toggling, which changes the SubTheme of the container every time the container is reloaded. We read the value from a toggle which needs to be created.

EvtInit
// function onContainer_6_EvtInit (apiObject, component, eventData) {

const useThemeToggle = apiObject.ui.getObject(1, "y-toggle");
const useDarkTheme = useThemeToggle.get("style", "thumb", "value");

if (useDarkTheme) {
component.set("generic", "meta", "SubTheme", "darkTheme");
} else {
component.set("generic", "meta", "SubTheme", "lightTheme");
}

// }